<%@ Page Language="C#" MasterPageFile="~/SFMaster.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="blog_Default" Title="Untitled Page" %>

<%@ Register Src="/UserControls/uctCategories.ascx" TagName="uctCategories" TagPrefix="uc1" %>
<%@ Register Src="/UserControls/uctEntryArchive.ascx" TagName="uctEntryArchive"
    TagPrefix="uc2" %>
<%@ Register Assembly="WebControls" Namespace="WebControls" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderArchive" runat="Server">
    <uc1:uctCategories ID="UctCategories1" runat="server" />
    <uc2:uctEntryArchive ID="UctEntryArchive1" runat="server" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" runat="Server">
    <table width="100%">
        <cc1:SFRepeater ID="sfrDays" runat="server" OnNeedsDataSource="sfrDays_NeedsDataSource"
            OnItemDataBound="sfrDays_ItemDataBound">
            <ItemTemplate>
                <tr>
                    <td align="center" class="GridHeader">
                        <%#Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "PublishDate")).ToShortDateString()%>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%">
                            <cc1:SFRepeater ID="sfrEntries" runat="server" OnItemCommand="sfrEntries_ItemCommand">
                                <ItemTemplate>
                                    <tr>
                                        <td class="title">
                                            <a href='<%#GenerateUrl(DataBinder.Eval(Container.DataItem, "PermalinkGUID"))%>'
                                                runat="server">
                                                <%#DataBinder.Eval(Container.DataItem, "Title")%>
                                            </a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="blogBody">
                                            <%#DataBinder.Eval(Container.DataItem, "Body")%>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            <%#DataBinder.Eval(Container.DataItem, "Categories")%>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="panelMainShowAll">
                                            <a href='<%#GenerateUrl(DataBinder.Eval(Container.DataItem, "PermalinkGUID"))%>'
                                                runat="server">
                                                <cc1:SFLabel ID="btnComments" runat="server"></cc1:SFLabel>(<%#DataBinder.Eval(Container.DataItem,"CommentCount") %>)</a>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                                <SeparatorTemplate>
                                    <tr>
                                        <td>
                                            <hr />
                                        </td>
                                    </tr>
                                </SeparatorTemplate>
                            </cc1:SFRepeater>
                        </table>
                    </td>
                </tr>
            </ItemTemplate>
            <SeparatorTemplate>
                <tr>
                    <td>
                        <hr />
                    </td>
                </tr>
            </SeparatorTemplate>
        </cc1:SFRepeater>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderEdit" runat="Server">
    <asp:Panel ID="pnlComments" runat="server">
        <table>
            <tr>
                <td class="panelMainShowAll">
                    <cc1:SFLinkButton ID="lblAddComment" runat="server" OnClick="lblAddComment_Click"></cc1:SFLinkButton>
                </td>
            </tr>
            <tr>
                <td>
                    <cc1:SFRepeater ID="sfrComments" runat="server" OnItemCommand="sfrComments_ItemCommand"
                        OnNeedsDataSource="sfrComments_NeedsDataSource">
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <%#Convert.ToDateTime(DataBinder.Eval(Container.DataItem,"CommentDate")).ToShortDateString() %>
                                    -
                                    <%#DataBinder.Eval(Container.DataItem,"CommentUserName") %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <%#DataBinder.Eval(Container.DataItem,"CommentBody") %>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <%#DataBinder.Eval(Container.DataItem,"CommentUserWebSite") %>
                                    <asp:ImageButton ImageUrl="~/images/delete.gif" ID="ibtDelete" Visible='<%#GetVisible() %>'
                                        runat="server" CommandName="DeleteComment" CommandArgument='<%#DataBinder.Eval(Container.DataItem,"CommentId") %>' />
                                </td>
                            </tr>
                        </ItemTemplate>
                        <SeparatorTemplate>
                            <tr>
                                <td>
                                    <hr />
                                </td>
                            </tr>
                        </SeparatorTemplate>
                    </cc1:SFRepeater>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="pnlAddComment" runat="server">
        <table>
            <tr>
                <td class="panelMainShowAll">
                    <cc1:SFLinkButton ID="lblShowComment" runat="server" OnClick="lblShowComment_Click"></cc1:SFLinkButton>
                </td>
            </tr>
            <tr>
                <td>
                    <cc1:SFLabel ID="lblCommentUserName" runat="server"></cc1:SFLabel>
                </td>
                <td>
                    <cc1:SFTextBox ID="txtCommentUserName" runat="server" ControlsLabel="lblCommentUserName"></cc1:SFTextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <cc1:SFLabel ID="lblCommentUserWebSite" runat="server"></cc1:SFLabel>
                </td>
                <td>
                    <cc1:SFTextBox ID="txtCommentUserWebSite" runat="server" ControlsLabel="lblCommentUserWebSite"
                        AllowNull="true"></cc1:SFTextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <cc1:SFLabel ID="lblCommentUserEmail" runat="server"></cc1:SFLabel>
                </td>
                <td>
                    <cc1:SFTextBox ID="txtCommentUserEmail" runat="server" ControlsLabel="lblCommentUserEmail"
                        AllowNull="true"></cc1:SFTextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <cc1:SFLabel ID="lblCommentBody" runat="server"></cc1:SFLabel>
                </td>
                <td>
                    <cc1:SFTextBox ID="txtCommentBody" runat="server" ControlsLabel="lblCommentBody"
                        TextMode="MultiLine" MaxLength="3000"></cc1:SFTextBox>
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <cc1:SFLabel ID="lblSecurityPicture" runat="server"></cc1:SFLabel>
                </td>
                <td>
                    <img src="~/Utils/SecurityPicture.aspx" runat="server" alt="" id="imgSecurityPicture" /><br />
                    <cc1:SFTextBox ID="txtSecurityPicture" runat="server" ControlsLabel="lblSecurityPicture"></cc1:SFTextBox>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
